class IUP_FLAT_SEPARATOR
--  Creates an interface element that is a Separator, but it does not have 
--  native decorations. It inherits from IUP_CANVAS.

inherit
	IUP_CANVAS
		redefine
			set_expand
		end
	IUP_WIDGET_CLIENTSIZE
	IUP_WIDGET_CLIENTOFFSET
	
create {ANY}
   flat_separator
	
feature {ANY}
	
	flat_separator
	   -- Create a new flat separator.
		local
			a_flat_separator: POINTER
		do
			a_flat_separator := int_flat_separator
			set_widget(a_flat_separator)
		end

	-- Attributes

	set_bar_size (value: INTEGER)
		-- (non inheritable): controls the size of the separator in the opposite 
		-- direction of its orientation. Default: 5.
		require
			value > 0
		do
			iup_open.set_attribute(Current, "BARSIZE", value.out)
		end

	set_rgb_color (red: INTEGER; green: INTEGER; blue: INTEGER)
		-- (non inheritable): Changes the color of the separator.
		-- Default: "192 192 192" (using the RGB values).
		do
			iup_open.set_attribute(Current, "COLOR", rgb_to_string(red, green, blue))
		end

	set_vertical_orientation
		-- The default value.
		do
			iup_open.set_attribute(Current, "ORIENTATION", "VERTICAL")
		end

	set_horizontal_orientation
		do
			iup_open.set_attribute(Current, "ORIENTATION", "HORIZONTAL")
		end

	set_expand (type: STRING)
		-- (non inheritable): Its behavior depends on the orientation. It will 
		-- expand in the direction of the separator, but occupying only the 
		-- available space.
		do
			Precursor (type)
		end

	set_style_line
		do
			iup_open.set_attribute(Current, "STYLE", "LINE")
		end

	set_style_sunken_line
	-- The default value.
		do
			iup_open.set_attribute(Current, "STYLE", "SUNKENLINE")
		end

	set_style_dual_lines
		do
			iup_open.set_attribute(Current, "STYLE", "DUALLINES")
		end

	set_style_grip
		do
			iup_open.set_attribute(Current, "STYLE", "GRIP")
		end

	set_style_fill
		do
			iup_open.set_attribute(Current, "STYLE", "FILL")
		end
				
feature {NONE}

	-- Internals

   int_flat_separator: POINTER
		external
			"C inline use %"eiffel-iup.h%""
      alias
			"return IupFlatSeparator ();"
      end
	
end -- class IUP_SEPARATOR

-- The MIT License (MIT)

-- Copyright (c) 2018, 2019 by German A. Arias

-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in 
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
